import base from './base'
/**
 * 答题接口
 */

export default class topic extends base {
	// 习题列表
	static topicData(param) {
		let url = this.baseUrl + `/exercise/knowexerlist.post`
		return this.post(url, param)
	}
	// 题目报错
	static wrongExercise(param) {
		let url = this.baseUrl + `/exercise/wrongExercise.add/`
		return this.post(url, param).then(res => {
				return res
		})
	}
	// 提交行为记录
	static submitData(param) {
    let url = this.baseUrl + `/questionRecord.put`
		return this.post(url, param).then(res => {
				return res
		})
	}

	static async sleep(time) {
		return new Promise((resolve) => setTimeout(resolve, time))
	}

	static resultData(packageId, colligatePackageId) {
		let url = this.baseUrl + `/answerResultsPage.get/${packageId}/${colligatePackageId}`
		return this.get(url)
	}

	// 获取下一个学习包ID
	static getNextStudyId(studyPackageId) {
		let url = this.baseUrl + `/study/next.get/${studyPackageId}`
		return this.get(url)
	}

	// 讲义
	static getHandouts(id) {
		let url = this.baseUrl + `/knowledge/handouts.get/${id}`
		return this.get(url)
	}

	// 提交做题信息
	static knowledgeNodeRecord(param) {
		let url = this.baseUrl + `/knowledgeNodeRecord.add`
		return this.post(url, param)
	}
}
